public static void main(String[] args) {
        addAndSubIn100();
    }

    /**
     * 生成100以内的加减混合运算 单运算符
     */
    public static void addAndSubIn100() {
        // 这里设置算式的总个数 题目总数
        int totalExercises = 60;
        List<String> result = new ArrayList<>();
        Random random = new Random();
        for (int i = 0; i < totalExercises; i++) {
            int num1 = random.nextInt(100);
            int num2 = random.nextInt(100);
            int operator = random.nextInt(2);
            // 0 表示加法，1 表示减法
            if (operator == 0) {
                if (num1 + num2 > 100) {
                    result.add(num1 / 2 + " + " + num2 / 2 + " = ");
                } else {
                    result.add(num1 + " + " + num2 + " = ");
                }
            } else {
                if (num1 >= num2) {
                    result.add(num1 + " - " + num2 + " = ");
                } else {
                    result.add(num2 + " - " + num1 + " = ");
                }
            }
        }
        for (int i = 0; i < result.size(); i += 5) {
            System.out.printf("%-18s%-18s%-18s%-18s%-8s",
                    result.get(i), result.get(i + 1), result.get(i + 2), result.get(i + 3), result.get(i + 4));
            System.out.println();
        }
    }